package file;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-08-07
 * Time: 11:20
 */
//推荐 : 对于文本文件, 推荐使用scanner
public class Demo08 {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = new FileInputStream("./test1.txt");
        Scanner scanner = new Scanner(inputStream);
        String s = scanner.next();
        System.out.println(s);
        inputStream.close();
    }
}
